-- extrl_magic_damage
-- created by wangy
-- 攻击时，额外魔法伤害%
return {
    apply = function(prop, baseValue)
        return baseValue;
    end,

    -- 击杀触发
    trigger = function(who, prop, arg)
        local damage = 0;
        local baseAttack = InterfaceM.calcBaseAttrib(who, "attack");
        damage = math.modf(baseAttack * prop[3] / 1000);

        damage = math.max(1,damage);

        -- 神赐附魔状态，坩埚加成
        local addon = 0;
        local p;
        local props = PropM.fetchProps(who, "divine");
        for _, p in ipairs(props) do
            addon = addon + tonumber(p[3]);
        end

        damage = damage + math.modf(damage * addon / 1000);
        return damage;
    end,

    record = function(target, prop, path)
        return false;
    end
};